import { Component, OnInit } from '@angular/core';
import { MessageService } from 'src/app/core/service/message.service';
import { ApiService } from 'src/app/core/api';
import { NzMessageService } from 'ng-zorro-antd';

@Component({
    templateUrl: './index.html',
    styleUrls: ['./index.scss']
})
export class SZTXComponent implements OnInit {
    header;
    user;
    imgUrl;
    ngOnInit() {
        this.message.setBreadcrumb({
            breadcrumbs: [
                { name: '我要检测' }
            ]
        });
        this.api.post('用户详情', {}).then(res => {
            this.user = res['data']['enterpriseUserDetail'];
            localStorage.setItem('user', JSON.stringify(this.user));
            this.imgUrl = this.user['image'];
        })
    }
    submit() {
        this.api.post('更新头像', {image:this.photo}).then((res: any) => {
            this.msg.success('保存成功');
        }).catch((res) => {
            this.msg.error(res.message);
        });
    }
    photo;
    constructor(
        private message: MessageService,
        private msg: NzMessageService,
        private api: ApiService
    ) { }
}